<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.*" %>
<%@page import="com.is.control.*" %>
<%@page import="com.is.model.*" %>
<%@page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/InterStu/resources/image/favicon.ico" />
<link rel="stylesheet" type="text/css" href="../../resources/css/all.css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<script type="text/javascript" src="../../resources/js/iframeTools.js"></script>
<script type="text/javascript">
	$(function(){
		var block = $("#magic_block");
		if($(".active a").position()){
			block.css("top",$(".active a").position().top+10)
			.data("oriTop",$(".active a").position().top)
		}
		$(".nav ul li").find("a").hover(
			function(){
				var $this = $(this);
				var newTop = $this.position().top;
				block.stop().animate({
					top:newTop+10
				})
			},
			function(){
				block.stop().animate({
					top:block.data("oriTop")+10
				})
			}
		)
		var h = $('.right').height();
		$(".left").height(h);
		$(".update").click(function(){
			$.dialog.open("/InterStu/update_info.jsp",{width:460,height:400,title:"个人信息"});
		})
		$('img').error(function(){
			this.src = "/InterStu/resources/image/man.GIF";
		})
	})
</script>
<title>留学生预科班</title>
</head>
<% 
	User cu =(User)session.getAttribute("user"); 
	request.setCharacterEncoding("UTF-8");
	DesData des = new DesData();
	int stuyear= ParamUtil.getInt(request,"stuyear",ParamStuyearControl.getCurrentStuyearId());
	int classId = Integer.parseInt(des.decrypt(ParamUtil.getString(request,"classId","e6b92e28c43dccd4")));
	List<ParamClass> pcs = ParamClassControl.getParamClassesByStuyear(ParamStuyearControl.getCurrentStuyearId());
	//System.out.println(pcs.size());
	if(pcs.size()>1){
%>
<body>
<div class="header">
	<div class="title pr">
    	<a href="javascript:void(0);"><span class="update pa">个人信息</span></a>
        <span class="logout pa"><a class="hide" href="/InterStu/login/logout.jsp">退出</a></span>
    </div>
</div>
<div class="main">
	<div class="left"> 
	   <div class="infomation">
			<div class="photo">
			<%
			String picUrl = cu.getPicUrl();
			%>
				<img width='60' height="60" src = "<%=picUrl %>"   />
			</div>
			<div class="welcome">
				<%=cu.getName() %>,<br/>
				欢迎您使用！
			</div>
		</div>  	   	  	  	
    	<div class="nav">
        	<ul>	
            	<li class="pa" id="magic_block"></li>
                <li><a href="/InterStu/pages/stuyear/stuyear_start.jsp">新学期设置</a></li>
                <li><a href="/InterStu/pages/users/user_all.jsp">用户管理</a></li>
                <li><a href="/InterStu/pages/students/student_add.jsp">学生管理</a></li>
                <li class="active"><a href="/InterStu/pages/dictation/dictation_add.jsp">学生考核</a></li>
                <li><a href="/InterStu/pages/assess/teacher_assess.jsp">教职人员管理</a></li>
            </ul>
        </div>
    </div>
    <div class="right">
    	<div class="r1">
    	<table class="dictations tab">
	    <tr>
	    	<td>
	    		<a href="/InterStu/pages/dictation/dictation_add.jsp">听写成绩</a>
			</td>
			<td>
				<a href="/InterStu/pages/homework/homework_add.jsp">作业成绩</a>			
			</td>
			<td>
				<a href="/InterStu/pages/courseScore/score_go.jsp">成绩录入</a>
			</td>
			<td>
				<a class="current" href="/InterStu/pages/evaluation/students_all.jsp">综合评价</a>
			</td>
	    </tr>
	    </table>
    	<form name='class' action='students_all.jsp' method='post' >
    	<table class="table">
    		<caption>请选择班级</caption>
    		<tr>
			<%
					
					for(ParamClass pc:pcs){
			%>
			<td><input name='classId' type="radio" onchange="javascript:document.forms['class'].submit();" value="<%=des.encrypt(pc.getId()+"") %>" <% out.print((pc.getId()==classId)?"checked":""); %>/>
			<%=pc.getClassName() %></td>
			<%	
					}
				} 
			%>
			
    		</tr>
    	</table>
    	</form>
			<%if(classId != 0 ){ %>
        </div>
        <div class="r2">
        <table class='table'>
        <caption>查询结果</caption>
		<thead>
			<tr>
				<th>中文姓名</th>
				<th>英文姓名</th>
				<th>班级</th>
				<th>操作</th>
			</tr>
		</thead>
		<%
				List<Student> students = StudentControl.getStudentByClassId(String.valueOf(classId));
				//System.out.print(students.size());
				for(Student s:students){
				Evaluation e = EvaluationControl.getEvaluationByStuyearAndStuId(s.getId(), stuyear);
				
		%>
		<tbody>
			<tr>
				<td><%=s.getChineseName() %></td>
				<td><%=s.getPassportName() %></td>
				<td><%=ParamClassControl.getClassName(Integer.parseInt(s.getClassId())) %></td>
				<td>
				<%if(e==null){
				%>
				<a href="evaluation_add.jsp?stuId=<%=des.encrypt(String.valueOf(s.getId())) %>&&stuyear=<%=des.encrypt(String.valueOf(stuyear)) %>">录入</a>
				<%
				}else{ %>
				 <a href="evaluation_update.jsp?stuId=<%=des.encrypt(String.valueOf(s.getId())) %>&&stuyear=<%=des.encrypt(String.valueOf(stuyear)) %>">修改</a>
				   <%} %>
				</td>
			</tr>
		<%
				}
			}else{
			
			out.print("选择班级");
			}
		%>
		</tbody>
		</table>
        </div>
    </div>
</div>
<div class="footer">
	<p>版权所有：东北师范大学留学生预科部&nbsp;&nbsp;  蓝旭工作室开发</p>
</div>
</body>
</html>